package com.project.class4_12.lambda;

import com.lovo.netCRM.component.LovoButton;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MyJFrame extends JFrame {

    public MyJFrame(){
        this.setLayout(null);

        LovoButton addButton = new LovoButton("添加",50,50,this);
        addButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("执行添加");
            }
        });

        LovoButton delButton = new LovoButton("删除",50,100,this);
        delButton.addActionListener(e -> {
                System.out.println("执行删除");
                System.out.println("lambda表达式");
            }
        );

        this.setSize(600,400);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
    }
    public static void main(String[] args) {
        new MyJFrame();
    }
}
